import http from "@/utils/request";

//  获取所有生产商信息并分页的接口
export function getAllManufacturerAndPageRequest (currentPage,pageSize) {
    return http({
        url:'/manufacturer',
        method:'get',
        data:{},
        params:{
            currentPage,pageSize
        }
    })
}

//  获取所有生产商信息的接口
export function getAllManufacturerRequest () {
    return http({
        url:'/manufacturer/getAllManufacturer',
        method:'get',
        data:{}
    })
}

//  添加生产商信息的接口
export function addManufacturerRequest (addManufacturerData) {
    return http({
        url:'/manufacturer',
        method:'post',
        data:addManufacturerData
    })
}

//  根据id查询生产商信息的接口
export function getManufacturerByIdRequest (manuId) {
    return http({
        url:`/manufacturer/${manuId}`,
        method:'get',
        data:{}
    })
}

//  更新生产商信息的接口
export function updateManufacturerRequest (updateManufacturerData) {
    return http({
        url:'/manufacturer',
        method:'put',
        data:updateManufacturerData
    })
}

//  根据id删除生产商信息的接口
export function deleteManufacturerByIdRequest (manuId) {
    return http({
        url:`/manufacturer/${manuId}`,
        method:'delete',
        data:{}
    })
}

//  根据生产商名称模糊查询生产商信息的接口
export function getManufacturerByNameRequest (getManufacturerByNameData) {
    return http({
        url:'/manufacturer/getManufacturerByName',
        method:'get',
        data:{},
        params:{
            searchByName:getManufacturerByNameData
        }
    })
}